package com.sxt.view;

import java.util.Scanner;

import com.sxt.entity.Account;
import com.sxt.service.impl.InputCheck;
import com.sxt.util.InputTools;

/**
 * 管理员操作界面类
 * @author lovemanai
 *
 */
public class AdminATMUI {
	private static Scanner input = new Scanner(System.in);
	
	/*
	 * 登陆界面
	 */
	public static Account loginView() {
		String accountNo = InputTools.getString("请输入账号:", input);
		String password = InputCheck.checkPassword();
		
		return new Account(accountNo, password);
	}

	/*
	 * 增加账户界面
	 */
	public static Account addAccountView() {
		String accountNo = InputTools.getString("请输入账号:", input);
		String password = InputCheck.checkPassword();
		double money = InputCheck.checkMoney();
		String userName = InputTools.getString("请输入姓名:", input);
		String id = InputTools.getString("请输入身份证号码：", input);
		String phoneNo = InputTools.getString("请输入手机号码：", input);
		String address = InputTools.getString("请输入地址：", input);
		
		return new Account(accountNo, password, money,userName,id, phoneNo, address);
	}
	
	/*
	 * 删除账户界面
	 */
	public static Account removeAccountView(String accountNo) {
		return new Account(accountNo);
	}
	
	/*
	 * 更新账户界面
	 * 只可以更改密码，手机号码，地址
	 */
	 public static Account updateAccountView(String accountNo) {
		 System.out.println("请输入更改内容：");
		 String password = InputCheck.checkPassword();
		 String phoneNo = InputTools.getString("请输入手机号码：", input);
		 String address = InputTools.getString("请输入地址：", input);
		 return new Account(password, phoneNo, address);
	 }
	 
	 /*
	  * 查询账户界面
	  * 
	  */
	 public static Account searchAccountView() {
		String accountNo = InputTools.getString("请输入账号：", input);
		return new Account(accountNo);
	 }
	 
	 /*
	  * 打印所有账户信息界面
	  */
	 public static void printAllView() {
		 System.out.println("所有账户信息:");
	 }
	 
	 /*
	  * 账户操作提示界面
	  */
	public static int accountManageView() {
		System.out.println("\n-------操作选项--------\n");
		System.out.println("1.添加账户");
		System.out.println("2.删除账户");
		System.out.println("3.更改账户");
		System.out.println("4.查询账户");
		System.out.println("5.打印所有账户");
		System.out.println("0.退出");
		
		return InputTools.getInt("请输入操作选项:", input);
	}
	
	/*
	 * 账号数据界面
	 */
	public static String accountNoView(String msg) {
		return InputTools.getString(msg, input);
	}
}